(function($){$.extend({metadata:{defaults:{type:'class',name:'metadata',cre:/({.*})/,single:'metadata'},setType:function(type,name){this.defaults.type=type;this.defaults.name=name;},get:function(elem,opts){var settings=$.extend({},this.defaults,opts);if(!settings.single.length)settings.single='metadata';data="{}";if(settings.type=="class"){var m=settings.cre.exec(elem.className);if(m)
data=m[1];}else if(settings.type=="elem"){if(!elem.getElementsByTagName)return;var e=elem.getElementsByTagName(settings.name);if(e.length)
data=$.trim(e[0].innerHTML);}else if(elem.getAttribute!=undefined){var attr=elem.getAttribute(settings.name);if(attr)
data=attr;}
if(data.indexOf('{')<0)
data="{"+data+"}";data=eval("("+data+")");$.data(elem,settings.single,data);return data;}}});$.fn.metadata=function(opts){return $.metadata.get(this[0],opts);};})(jQuery);;
var max=0;function AsylumNavLink(parentId,linkId,order,href,linkText,target,width)
{this.linkId=linkId;this.parentId=parentId;this.order=order;this.href=href;this.linkText=linkText;this.target=target;this.width=width;};function AsylumNav(contId,layout,offset)
{this.menuCont=document.getElementById(contId);this.layout=layout;this.offset=(typeof offset=='undefined'?'Right':offset);this.menuItems=new Object();this.clickUnderCreated=false;};AsylumNav.prototype.AddLink=function(parentId,linkId,order,href,linkText,target,width)
{if(typeof this.menuItems[parentId]=='undefined')
{this.menuItems[parentId]=new Object();}
if(typeof width=="undefined")width=false;this.menuItems[parentId][linkId]=new AsylumNavLink(parentId,linkId,order,href,linkText,target,width);if(order>max){max=order;}};AsylumNav.prototype.CreateLevel=function(levelId,idPrefix)
{obj=this;div=document.createElement('div');div.id=idPrefix+levelId;div.levelId=levelId;div.idPrefix=idPrefix;div.className='levelDiv';div.onmouseout=function(e){obj.HideLevel(e);};div.subLevels=new Object();if(levelId!='0')
{div.style.visibility='hidden';div.className+=' subLevel';div.style.position='absolute';}
else
{div.className+=' topLevel';}
if(this.layout=='Horizontal')
{div.style.position='absolute';}
div.style.zIndex=10;if(this.menuCont){this.menuCont.appendChild(div);}
for(i=0;i<=max;i++){for(linkId in this.menuItems[levelId]){if(this.menuItems[levelId][linkId].order==i){linkDiv=document.createElement('div');linkDiv.id='asylumNavLinkDiv'+linkId;linkDiv.linkId=linkId;linkDiv.levelId=levelId;linkDiv.className='linkDiv';if(levelId=="0"){linkDiv.className+=" topLevel";if(this.menuItems[levelId][linkId].width){linkDiv.style.width=this.menuItems[levelId][linkId].width+"px";}}
div.appendChild(linkDiv);navLink=this.menuItems[levelId][linkId];a=document.createElement('a');a.id='asylumNavLink'+linkId;a.linkType='navMenu';a.linkId=linkId;a.levelId=navLink.parentId;a.parentId=navLink.parentId;if(navLink.href==''||navLink.href=='#')
{a.href='#';a.target='';a.style.cursor='default';}
else
{a.href=navLink.href;a.target=navLink.target;}
if(this.layout=='Vertical')
{a.innerHTML=navLink.linkText;}
else
{a.innerHTML=navLink.linkText.split(' ').join('&nbsp;');}
a.onmouseover=function(){obj.ShowLevel(this);};linkDiv.appendChild(a);if(linkId==pageId)
{a.className='activeLink';linkDiv.className+=' activeLink';topLink=this.GetTopLevelLink(navLink);if(typeof this.menuItems[topLink.linkId]!='undefined'&&navLink.levelId!='0')
{try{document.getElementById('asylumNavLink'+topLink.linkId).className+=' activeLink';document.getElementById('asylumNavLinkDiv'+topLink.linkId).className+=' activeLink';}catch(e){}}
if(document.getElementById("clickUnder")!=null)
{this.CreateClickUnder(topLink,true);}}
else
{}
if(typeof this.menuItems[linkId]!='undefined')
{div.subLevels[linkId]=true;}}}}
return div;};AsylumNav.prototype.Construct=function()
{if(this.menuCont==null){return;}
var obj=this;for(levelId in this.menuItems)
{this.CreateLevel(levelId,'asylumNavLevel');}
if(this.layout=='Vertical')
{if(typeof document.getElementById('tplMainSectors')!=null)
{ms=document.getElementById('tplMainSectors');ms.style.height=ms.offsetHeight;}}
else
{this.menuCont.style.height=document.getElementById('asylumNavLevel0').offsetHeight+'px';}
this.CreateBreadCrumbs();};AsylumNav.prototype.CreateClickUnder=function(navLink,active)
{if(typeof doneClickUnder=="undefined"){doneClickUnder=true;}else{return;}
if(document.getElementById("clickUnder")==null)return;obj=this;var linkId;if(this.layout=='Vertical')
{clickDiv=document.createElement('div');clickDiv.id="clickUnder";document.getElementById("clickUnder").appendChild(clickDiv);linkDiv=document.getElementById('asylumNavLinkDiv'+navLink.linkId);linkDiv.appendChild(clickDiv);}
else
{clickDiv=document.getElementById("clickUnder");}
var linkCount=0;for(linkId in this.menuItems[navLink.linkId])
{linkCount++;clickLinkDiv=document.createElement('div');clickLinkDiv.className='clickLinkDiv';clickLink=this.menuItems[navLink.linkId][linkId];txt=document.createTextNode(' ');clickDiv.appendChild(txt);a=document.createElement('a');a.id='asylumNavClickLink'+clickLink.linkId;a.className='clickLink';a.linkType='clickLink';a.linkId=linkId;a.levelId=clickLink.parentId;a.parentId=clickLink.parentId;if(clickLink.href==''||clickLink.href=='#'){a.href='#';a.target='';a.style.cursor='default';}else{a.href=clickLink.href;a.target=clickLink.target;}
if(this.layout=="Vertical"){a.innerHTML=clickLink.linkText;}else if(this.layout=="Horizontal-SubMenu"){if(clickLink.linkText.substring(0,1)==" "){a.innerHTML=clickLink.linkText.split(" ").join("&nbsp;");}else{a.innerHTML=clickLink.linkText;}}else{a.innerHTML=clickLink.linkText.split(" ").join("&nbsp;");}
a.onmouseover=function(){obj.HideAllLevels();obj.ShowLevel(this);};a.onmouseout=function(e){obj.HideLevel(e);};clickLinkDiv.appendChild(a);if(linkId==pageId)
{a.className='activeLink';clickLinkDiv.className+=' activeLink';}
clickDiv.appendChild(clickLinkDiv);txt=document.createTextNode(' ');clickDiv.appendChild(txt);}
if(linkCount==0||active==false)
{clickDiv.className='inactiveClickUnder';}
else
{clickDiv.className='activeClickUnder';}};AsylumNav.prototype.GetTopLevelLink=function(navLink)
{if(navLink.parentId=='0')
{return(navLink);}
while(1==1)
{navLink=this.GetParentLink(navLink);if(typeof navLink.parentId!='undefined')
{if(navLink.parentId=='0')
{break;}}}
return(navLink);};AsylumNav.prototype.GetParentLink=function(navLink)
{var levelId;var linkId;for(levelId in this.menuItems)
{for(linkId in this.menuItems[levelId])
{parNavLink=this.menuItems[levelId][linkId];if(parNavLink.linkId==navLink.parentId)
{return(parNavLink);}}}};AsylumNav.prototype.GetXPos=function(obj)
{var curleft=0;if(obj.offsetParent)
{while(obj.offsetParent&&obj.id!='navMenuCont')
{curleft+=obj.offsetLeft;obj=obj.offsetParent;}}
else if(obj.x)
curleft+=obj.x;return curleft;};AsylumNav.prototype.GetYPos=function(obj)
{var curtop=0;if(obj.offsetParent)
{while(obj.offsetParent&&obj.id!='navMenuCont')
{curtop+=obj.offsetTop;obj=obj.offsetParent;}}
else if(obj.y)
curtop+=obj.y;return curtop;};AsylumNav.prototype.ShowLevel=function(el)
{levelId=el.linkId;this.currentLevelId=levelId;window.clearTimeout(this.timeoutId);this.HideSubLevels(el.levelId);if(typeof this.menuItems[levelId]=='undefined')
{return;}
if(el.linkType=='clickLink')
{eP=document.getElementById('asylumNavClickLink'+el.linkId);eL=document.getElementById('asylumNavLevel'+levelId);SwapClass(eL,'subLevel','clickUnderSubLevel');}
else
{eP=document.getElementById('asylumNavLink'+levelId);eL=document.getElementById('asylumNavLevel'+levelId);SwapClass(eL,'clickUnderSubLevel','subLevel');}
if(eP.parentId=='0')
{switch(this.offset)
{case'Right':offsetX=(eP.offsetWidth);offsetY=0;break;case'Left':offsetX=(-eL.offsetWidth);offsetY=0;break;case'Bottom':offsetX=0;offsetY=eP.offsetHeight;eL.style.minWidth=eP.offsetWidth;break;}}
else
{switch(this.offset)
{case'Left':offsetX=(-eL.offsetWidth);offsetY=0;break;default:offsetX=(eP.offsetWidth);offsetY=0;break;}}
pX=this.GetXPos(eP);pY=this.GetYPos(eP);lX=pX+offsetX;lY=pY+offsetY;eL.style.position='absolute';$(eL).css({left:lX,top:lY});eL.style.visibility='visible';};AsylumNav.prototype.GetLevelWidth=function(levelId)
{maxWidth=0;for(linkId in this.menuItems[levelId])
{a=document.getElementById('asylumNavLink'+linkId);thisWidth=a.offsetWidth;if(thisWidth>maxWidth)
{maxWidth=thisWidth;}}
return(maxWidth);};AsylumNav.prototype.HideSubLevels=function(levelId,omitLevelId)
{if(typeof omitLevelId=='undefined')
{omitLevelId='0';}
eL=document.getElementById('asylumNavLevel'+levelId);for(levelId in eL.subLevels)
{this.HideSubLevels(levelId);if(levelId!=omitLevelId)
{eL=document.getElementById('asylumNavLevel'+levelId);eL.style.visibility='hidden';}}};AsylumNav.prototype.HideLevel=function(e)
{window.clearTimeout(this.timeoutId);if(!e)e=window.event;var el=(e.relatedTarget)?e.relatedTarget:e.toElement;var obj=this;var funct=function(){obj._HideLevel(el);};this.timeoutId=window.setTimeout(funct,1000);};AsylumNav.prototype._HideLevel=function(el)
{if(!el||el.id.substr(0,9)!='asylumNav'||(el.id.substr(0,9)=='asylumNav'&&el.style.visibility=='hidden'))
{this.HideAllLevels();}};AsylumNav.prototype.HideAllLevels=function()
{for(levelId in this.menuItems)
{if(levelId!='0')
{eL=document.getElementById('asylumNavLevel'+levelId);if(eL!=null)eL.style.visibility='hidden';}}};AsylumNav.prototype.CreateBreadCrumbs=function()
{if(document.getElementById("breadCrumbs")!=null)
{crumbsCont=document.getElementById("breadCrumbs");crumbsCont.style.display='none';crumbs='';homeLink='';for(levelId in this.menuItems)
{for(linkId in this.menuItems[levelId])
{navLink=this.menuItems[levelId][linkId];if(homeLink=='')
{homeLink='<a href="'+navLink.href+'" target="'+navLink.target+'">'
+navLink.linkText+'</a> &gt; ';}
if(linkId==pageId)
{i=0;parNavLink=this.GetParentLink(navLink);while(typeof parNavLink=='object')
{i++;crumbs='<a href="'+parNavLink.href+'" target="'+parNavLink.target+'">'
+parNavLink.linkText+'</a> &gt; '+crumbs;parNavLink=this.GetParentLink(parNavLink);}
if(i>1)
{crumbsCont.style.display='block';crumbsCont.innerHTML=homeLink+crumbs+'<span class="activeCrumb">'+navLink.linkText+'</span>';}
return(true);}}}}};function RemoveClass(el,className)
{var replaceName=(el.className.match(' '+className)?' '+className:className);el.className=el.className.replace(replaceName,'');};function AddClass(el,className)
{RemoveClass(el,className);el.className+=' '+className;};function SwapClass(el,removeClassName,addClassName)
{RemoveClass(el,removeClassName);AddClass(el,addClassName);};;$(function() {for (var i in tasks) {window.setTimeout(tasks[i], 0);}});function initMenu(){};$(function(){$("#navMenu").navmenu({pageInfo:{"a361981":{"P":0,"ID":619605,"C":361981,"O":0,"U":"http:\/\/www.trinitygroup.co.nz\/","N":"Home","T":"_top","R":"","RT":"_blank"},"a362618":{"P":361981,"ID":362618,"C":362618,"O":"1","U":"http:\/\/www.trinitygroup.co.nz\/bars-hotels-venues.html","N":"About","T":"_top","R":"","RT":"_blank"},"a454992":{"P":362618,"ID":454997,"C":454992,"O":"1","U":"http:\/\/www.trinitygroup.co.nz\/hospitality-jobs-work.html","N":"Job Opportunities","T":"_top","R":"","RT":"_blank"},"a362619":{"P":361981,"ID":362619,"C":362619,"O":"2","U":"http:\/\/www.trinitygroup.co.nz\/events-venues-bars.html","N":"Venues","T":"_top","R":"","RT":"_blank"},"a485979":{"P":362619,"ID":485982,"C":485979,"O":"1","U":"","N":"WELLINGTON CITY","T":"","R":"","RT":"_blank"},"a362621":{"P":362619,"ID":511855,"C":362621,"O":"2","U":"http:\/\/www.trinitygroup.co.nz\/cambridge-hotel-accommodation.html","N":"   Cambridge Hotel","T":"_top","R":"","RT":"_blank"},"a362622":{"P":362619,"ID":511856,"C":362622,"O":"3","U":"http:\/\/www.trinitygroup.co.nz\/accommodation-trinity-hotel.html","N":"   Trinity Hotel","T":"_top","R":"","RT":"_blank"},"a362624":{"P":362619,"ID":511857,"C":362624,"O":"4","U":"http:\/\/www.trinitygroup.co.nz\/occidental-bar-meals.html","N":"   The Occidental","T":"_top","R":"","RT":"_blank"},"a362626":{"P":362619,"ID":511858,"C":362626,"O":"5","U":"http:\/\/www.trinitygroup.co.nz\/el-horno-bar.html","N":"   El Horno","T":"_top","R":"","RT":"_blank"},"a467287":{"P":362619,"ID":511859,"C":467287,"O":"6","U":"http:\/\/www.trinitygroup.co.nz\/st-johns-hotel.html","N":"   St Johns Heineken <br>   Hotel","T":"_top","R":"","RT":"_blank"},"a362625":{"P":362619,"ID":511861,"C":362625,"O":"8","U":"http:\/\/www.trinitygroup.co.nz\/realm-bar-bistro.html","N":"   The Realm Bar &amp; Bistro","T":"_top","R":"","RT":"_blank"},"a500268":{"P":362619,"ID":500271,"C":500268,"O":"9","U":"","N":"WIDER WELLINGTON <br>REGION","T":"","R":"","RT":"_blank"},"a362623":{"P":362619,"ID":511862,"C":362623,"O":"10","U":"http:\/\/www.trinitygroup.co.nz\/exchange-hotel-tab.html","N":"   Exchange Hotel","T":"_top","R":"","RT":"_blank"},"a362627":{"P":362619,"ID":511863,"C":362627,"O":"11","U":"http:\/\/www.trinitygroup.co.nz\/tote-furnace-bar.html","N":"   Tote &amp; Furnace","T":"_top","R":"","RT":"_blank"},"a362620":{"P":362619,"ID":511864,"C":362620,"O":"12","U":"http:\/\/www.trinitygroup.co.nz\/hotel-bar-waikanae.html","N":"   Waikanae Hotel","T":"_top","R":"","RT":"_blank"},"a500273":{"P":362619,"ID":500275,"C":500273,"O":"13","U":"","N":"PALMERSTON NORTH","T":"","R":"","RT":"_blank"},"a362628":{"P":362619,"ID":511865,"C":362628,"O":"14","U":"http:\/\/www.trinitygroup.co.nz\/albert-sports-bar.html","N":"   Albert Sports Bar","T":"_top","R":"","RT":"_blank"},"a362629":{"P":362619,"ID":511866,"C":362629,"O":"15","U":"http:\/\/www.trinitygroup.co.nz\/office-bar-sport.html","N":"   The Office Bar","T":"_top","R":"","RT":"_blank"},"a362630":{"P":362619,"ID":511867,"C":362630,"O":"16","U":"http:\/\/www.trinitygroup.co.nz\/empire-hotel-bar.html","N":"   The Empire Hotel","T":"_top","R":"","RT":"_blank"},"a362631":{"P":362619,"ID":511868,"C":362631,"O":"17","U":"http:\/\/www.trinitygroup.co.nz\/murphy-s-law.html","N":"   Murphy's Law, Palm Nth","T":"_top","R":"","RT":"_blank"},"a500287":{"P":362619,"ID":500288,"C":500287,"O":"18","U":"","N":"HAWKES BAY","T":"","R":"","RT":"_blank"},"a362632":{"P":362619,"ID":511869,"C":362632,"O":"19","U":"http:\/\/www.trinitygroup.co.nz\/clive-river-hotel.html","N":"   Clive River Bar &amp; <br>   Restaurant","T":"_top","R":"","RT":"_blank"},"a468071":{"P":362619,"ID":511870,"C":468071,"O":"20","U":"http:\/\/www.trinitygroup.co.nz\/clive-motel-accommodation.html","N":"   Clive Motel","T":"_top","R":"","RT":"_blank"},"a362634":{"P":362619,"ID":592094,"C":362634,"O":"21","U":"http:\/\/www.trinitygroup.co.nz\/bar-pub-hotel.html","N":"   Turks Bar","T":"_top","R":"","RT":"_blank"},"a490889":{"P":361981,"ID":490890,"C":490889,"O":"3","U":"http:\/\/www.trinitygroup.co.nz\/accommodation-hotels-motels.html","N":"Accommodation","T":"_top","R":"","RT":"_blank"},"a490891":{"P":490889,"ID":490894,"C":490891,"O":"1","U":"http:\/\/www.trinitygroup.co.nz\/trinity-hotel-accommodation.html","N":"Trinity Hotel, Wellington City","T":"_top","R":"","RT":"_top"},"a490892":{"P":490889,"ID":490895,"C":490892,"O":"2","U":"http:\/\/www.trinitygroup.co.nz\/cambridge-hotel-restaurant.html","N":"Cambridge Hotel, Wellington City","T":"_top","R":"","RT":"_top"},"a507665":{"P":490889,"ID":507667,"C":507665,"O":"3","U":"http:\/\/www.trinitygroup.co.nz\/waikanae-hotel-bar.html","N":"Waikanae Hotel, Kapiti Coast","T":"_top","R":"","RT":"_blank"},"a507675":{"P":490889,"ID":507689,"C":507675,"O":"4","U":"http:\/\/www.trinitygroup.co.nz\/empire-hotel-accommodation.html","N":"Empire Hotel, Palmerston North","T":"_top","R":"","RT":"_blank"},"a490893":{"P":490889,"ID":490896,"C":490893,"O":"5","U":"http:\/\/www.trinitygroup.co.nz\/accommodation-clive-motel.html","N":"Clive Motel, Hawkes Bay","T":"_top","R":"","RT":"_top"},"a362636":{"P":361981,"ID":362636,"C":362636,"O":"4","U":"http:\/\/www.trinitygroup.co.nz\/bottle-stores-alcohol.html","N":"Bottle Stores","T":"_top","R":"","RT":"_blank"},"a362637":{"P":361981,"ID":362637,"C":362637,"O":"5","U":"http:\/\/www.trinitygroup.co.nz\/resorts-holidays-vanuatu.html","N":"Resorts","T":"_top","R":"","RT":"_blank"},"a362638":{"P":362637,"ID":362638,"C":362638,"O":"1","U":"http:\/\/www.trinitygroup.co.nz\/sunset-bungalows-vanuatu.html","N":"Sunset Bungalows, Vanuatu","T":"_top","R":"","RT":"_blank"},"a362639":{"P":362637,"ID":362639,"C":362639,"O":"2","U":"http:\/\/www.trinitygroup.co.nz\/chantilly-resort-accommodation.html","N":"Chantilly's on the Bay","T":"_top","R":"","RT":"_blank"},"a419326":{"P":361981,"ID":419326,"C":419326,"O":"6","U":"http:\/\/www.trinitygroup.co.nz\/hospitality-events-venues.html","N":"Services","T":"_top","R":"","RT":"_blank"},"a362635":{"P":419326,"ID":362635,"C":362635,"O":"1","U":"http:\/\/www.trinitygroup.co.nz\/scarlet-events-venue.html","N":"Scarlet Events\/Basin Reserve","T":"_top","R":"","RT":"_blank"},"a362640":{"P":419326,"ID":362640,"C":362640,"O":"2","U":"http:\/\/www.trinitygroup.co.nz\/hospitality-consulting-service.html","N":"Hospitality Consulting Service","T":"_top","R":"","RT":"_blank"},"a362642":{"P":419326,"ID":362642,"C":362642,"O":"4","U":"http:\/\/www.trinitygroup.co.nz\/general-commercial-finance.html","N":"Finance","T":"_top","R":"","RT":"_blank"},"a614391":{"P":361981,"ID":628778,"C":614391,"O":"7","U":"http:\/\/www.trinitygroup.co.nz\/hospitality-industry-news.html","N":"News","T":"_top","R":"","RT":"_blank"},"a362644":{"P":361981,"ID":362644,"C":362644,"O":"8","U":"http:\/\/www.trinitygroup.co.nz\/restaurants-bars-pubs.html","N":"Contact","T":"_top","R":"","RT":"_blank"}},alignment:"Horizontal",animate:0})});